#!/bin/bash

PYTHON=$(which python)
ASSEMBLER=../../assembler.py

if [ $# -eq 1 ]
then
	OPTIONS="-n $1"
	FILENAME_SUFFIX="_n$1.mif"
else
	OPTIONS=""
	FILENAME_SUFFIX=".mif"
fi

for asmfile in $(ls *.a32)
do
	echo "Assembling $asmfile..."
	$PYTHON $ASSEMBLER $asmfile $OPTIONS -o ${asmfile%.a32}$FILENAME_SUFFIX
done
